package tc.de.krawallmann.gravoblocks.resource;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * The Class Language.
 */
public final class Language {

	/** The Constant BUNDLE_NAME. */
	private static final String BUNDLE_NAME = "tc.de.krawallmann.gravoblocks.resource.Language"; //$NON-NLS-1$

	/** The Constant RESOURCE_BUNDLE. */
	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
			.getBundle(Language.BUNDLE_NAME);

	/**
	 * Gets the string.
	 * 
	 * @param key
	 *            the key
	 * @return the string
	 */
	public static String getString(final String key) {
		String ret;
		try {
			ret = Language.RESOURCE_BUNDLE.getString(key);// NOPMD
		} catch (final MissingResourceException e) {
			ret = "String not found: \"" + key + '\"';
		}
		return ret;
	}

	/**
	 * Instantiates a new language.
	 */
	private Language() {
		super();
	}
}
